import 'package:kmxy_base/base/base_package.dart';

import 'list_page_state.dart';

class ListPageView extends ListPageState {
  Widget itemView(BuildContext context, int index, String itemData) {
    return SizedBox(
      height: 50,
      child: Text(itemData),
    );
  }

  @override
  Widget setPageContent(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          "列表案例",
        ),
        actions: [
          UnconstrainedBox(
            child: InkWell(
              onTap: mapPickerMore,
              child: Container(
                height: 22.w,
                margin: EdgeInsets.only(right: 10.w),
                padding: const EdgeInsets.only(
                    top: 0, left: 10, bottom: 0, right: 10),
                child: const Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text('选择器'),
                  ],
                ),
              ),
            ),
          )
        ],
      ),
      body: SafeArea(
        child: GridListView(
          dataList,
          (context, index, itemData) => itemView(context, index, itemData),
          onGridListViewCreated,
          onRefresh: onRefresh,
          onLoading: onLoading,
        ),
      ),
    );
  }
}
